package kit.edu.lego.gruppe3.levels.rollbridge;

import kit.edu.lego.gruppe3.ComponentsRepository;
import kit.edu.lego.gruppe3.levels.LevelSelector;
import kit.edu.lego.gruppe3.sensors.Scanner;
import lejos.robotics.subsumption.Behavior;

public class MoveOverBridge implements Behavior{

	
	@Override
	public void action() {
		ComponentsRepository.getInstance().getRobotPilot().setTravelSpeed((Math.random()+1)*10); // OMG! It's over 9000!!!
		ComponentsRepository.getInstance().getRobotPilot().forward();
		Scanner.scanAt((int) Math.floor((Math.random()*19)*10)-90);
	}

	@Override
	public void suppress() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean takeControl() {
		return LevelSelector.getInstance().isRollBridge();
	}

}
